<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html>
<html>
	<head>
		<base href="<%=basePath%>">
		<title>后台</title>
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<meta
			content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'
			name='viewport'>
		<link rel="stylesheet" href="<%=basePath%>css/top.css" />
		<link rel="stylesheet"
			href="framework/bootstrap-3.0.0/css/bootstrap.css">
		<link rel="stylesheet"
			href="framework/bootstrap-3.0.0/css/bootstrap-theme.css">
		 <link href="<%=basePath%>common/plugins/datatables/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
		 <script src="<%=basePath%>common/plugins/jQuery/jQuery-2.1.3.min.js"></script>
         <script src="<%=basePath%>common/plugins/datatables/jquery.dataTables.js" type="text/javascript"></script>
         <script src="<%=basePath%>common/plugins/datatables/dataTables.bootstrap.js" type="text/javascript"></script>
	</head>

	<jsp:include page="aa.jsp"></jsp:include>
	<body>
		<div>
			<!-- Content Wrapper. Contains page content -->
			<div class="">

				<!-- Content Header (Page header) -->
				<section class="content-header">
				<h1>
					<ol class="breadcrumb">

						<li>
							动态列表信息
						</li>
					</ol>
				</h1>


				</section>
				<!-- Main content -->
				<section class="content">
				<a href="admin/addactivitys.jsp" style="margin-right: 0px;"><button
						class="btn  btn-info btn-xs info" style="width: 80px;">
						添加
					</button> </a>
				<div class="row">
					<div class="col-xs-12">

						<div class="box">

							<div class="box-body">

								<table id="example2" class="table table-bordered table-hover">
								<thead>
									<tr>
										<th>
											标题
										</th>
										<th>
											时间
										</th>
										<th>
											操作
										</th>
									</tr>
									</thead>
									<tbody>
									<c:forEach items="${requestScope.show}" var="activitys">
										<tr>

											<td>
												<a href="<%=basePath%>activitysinfo.do?id=${activitys.id}">${activitys.title}</a>
											</td>
											<td>
												${activitys.time}
											</td>
											<td>
												<button onclick="show(${activitys.id})"
													class="btn  btn-info btn-xs info" style="width: 50px;">
													查看
												</button>
												<button onclick="pub(${activitys.id})"
													class="btn  btn-info btn-xs info" style="width: 50px;">
													发布
												</button>
												<button onclick="del(${activitys.id})"
													class="btn  btn-info btn-xs info" style="width: 50px;">
													删除
												</button>
											</td>
										</tr>
									</c:forEach>
									
									</tbody>
								</table>
							</div>
							<!-- /.box-body -->
						</div>
						<!-- /.box -->
					</div>
					<!-- /.col -->
				</div>
				<!-- /.row -->
				</section>
				<!-- /.content -->
			</div>
			<!-- /.content-wrapper -->
		</div>
		<!-- ./wrapper -->
		<script type="text/javascript">
		$("#example2").dataTable({
		 	"bPaginate": true, // 翻页功能
			"bLengthChange": false, // 改变每页显示数据数量
			"bFilter": false, // 过滤功能
			"bSort": false, // 排序功能
			"bInfo": true, // 页脚信息
			"oLanguage" : {
                "sLengthMenu" : "每页显示_MENU_条记录",
                "sZeroRecords" : "抱歉， 没有找到记录",
                "sInfo" : "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                "sInfoEmpty" : "没有数据",
                "sInfoFiltered" : "(从 _MAX_ 条数据中检索)",
                "oPaginate" : {
                    "sFirst" : "首页",
                    "sPrevious" : "前一页",
                    "sNext" : "后一页",
                    "sLast" : "尾页"
                },
                "sZeroRecords" : "没有检索到数据",
                "sProcessing" : "正在加载中..."
            },
			"bAutoWidth": true, // 自动宽度
		});
	  function del(id) {
	  	location.href= "<%=basePath%>delactive.do?id="+id; 
	  }
	  function pub(id) {
	  	location.href= "<%=basePath%>pubactive.do?id="+id; 
	  }
	  function show(id) {
	  	location.href= "<%=basePath%>activitysinfo.do?id="+id; 
	  }
	</script>
	</body>
</html>
